package lab02.test34;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2017/11/22.
 */
public class Test {
    public static void main(String[] args) {
        String[] strings=new String[4];
        List<String> list=new ArrayList<>();
        list.add(strings[0]="apple");
        list.add(strings[1]="grape");
        list.add(strings[2]="banana");
        list.add(strings[3]="pear");
        for (int i=0;i<list.size();i++){
            System.out.println(list.get(i));
        }
        String s=strings[0],z=strings[0];
        for (int j=0;j<4;j++){
            if (s.length()<strings[j].length()){
                s=strings[j];
            }else {
                z=strings[j];
            }
            System.out.println("max为："+s+""+"min为"+z);
        }

    }
}
